package nl.maarten.docenthelp.entity;

import java.io.IOException;
import java.net.DatagramSocket;
import java.net.ServerSocket;

public class Server 
{
	private ServerSocket listenSocket;
	
	private DatagramSocket udpSocket;
	
	private int port = -1;
	private int udpPort = -1;
	
	public Server(int port, int udpPort)
	{
		this.port = port;
		this.udpPort = udpPort;
		
		init();
	}
	
	private void init()
	{
		try
		{
			listenSocket = new ServerSocket(port);
			udpSocket = new DatagramSocket( udpPort );
		}
		catch(IOException e)
		{
			e.printStackTrace();
		}
	}
	
	public ServerSocket getListenSocket()
	{
		return listenSocket;
	}
	
	public DatagramSocket getUdpSocket()
	{
		return udpSocket;
	}
}
